********************************************************************************
*** Instructions for replication of analyses presented in 
*** Milner, Helen. 2021. Voting for Populism in Europe: Globalization, Technological Change, and the Extreme Right
*** 
*** Comparative Political Studies
********************************************************************************
****************************************
*** I. Folder setup
****************************************
- Ensure that the "setup", "output", and "data" folders from the dataverse are downloaded and in one central folder

- Within the "output" directory, make an "appendix" subdirectory

****************************************
*** II. Install required packages
****************************************
ccode - .ado file from http://www.columbia.edu/~rh2883/stats.html

weakivtest - ssc install weakivtest

avar - ssc install avar

twostepweakiv - ssc install twostepweakiv 

ivreg2 - ssc install ivreg2

moremata - ssc install moremata

ranktest - ssc install ranktest

mimrgns - ssc install mimrgns

unique - ssc install unique

renvars - findit renvars 
	then select dm88_1

misum - ssc install misum

****************************************
*** III. .do files for analysis (setup folder)
****************************************
- Figure1.do reproduces Figure 1: Economic & Social Globalization 1970-2018

- Figure2.do reproduces Figure 2: Manufacturing Imports 1990 - 2018

- Figure3.do reproduces Figure 3: Parliamentary Elections in Europe 1970-2019

- Figure4.do reproduces Figure 4: Marginal Effect of Post-Crisis on Vote Shares

- Individual Level Tables and Figures.do reproduces the following:
	 Table 3: ESS Individual Data (Unemployment Benefits) Ref Category Other
	 Figure 5: Marginal Effects of Unemployment Benefits on Vote Choice OLS
	 Figure A1: Marginal Effects of Unemployment Benefits on Vote Choice 
	 Table A13: ESS Individual Data (Unemployment Benefits) Ref Category Main Right
	 Table A14: ESS Individual Data (Unemployment Benefits) OLS
	 Table A15: ESS Individual Data: Post-Crisis, 2002-2016
	 Table A16: ESS Individual Data: China Shock X Post-Crisis, 2002-2016 OLS
	 Table A17: ESS Individual Data: Unemployment Benefits, 2002-2016 Low-Wage Imports
	 Table A18: ESS Individual Data: Low-Wage X Benefits, 2002-2016
	 Table A19: ESS Individual Data: Post-Crisis, 2002-2016
	 Table A20: ESS Individual Data: Low-Wage X Crisis, 2002-2016

- Regional Voting Tables.do reproduces the following:
	 Table 1: Regional Voting (Populist Parties)
	 Table 2: Regional Voting (Centrist Parties)
	 Table A11: Regional Voting, Low Wage Imports (Populist Parties)
	 Table A12: Regional Voting, Low Wage Imports (Centrist Parties)

- SUREG_analysis.do reproduces the following:
	 Table A7: SUREG: Vote Share, 1990-2018
	 Table A8: SUREG: Vote Share w/ Interactions, 1990-2018
	 Table A9: SUREG: Vote Share, 1990-2018 Low Wage Imports
	 Table A10: SUREG: Vote Share w/ Interactions, 1990-2018 Low Wage Imports

- Tables A3 and A4.do reproduces the following: 
	 Table A3: Summary Statistics (MI Data)
	 Table A4: MI Estimate of Correlations

- Unimputed Regional Voting Tables.do reproduces the following:
	 Table A21: Regional Voting (Populist Parties) Unimputed Data
	 Table A22: Regional Voting (Centrist Parties) Unimputed Data
	 Table A23: Regional Voting, Low Wage Imports (Populist Parties) Unimputed Data
	 Table A24: Regional Voting, Low Wage Imports (Centrist Parties) Unimputed Data

*********************************************************
*** IV. Datasets
*********************************************************
The following datasets are used in the above listed .do files 

- Figure1.do 
	data/wdi/var_labels_complete.xlsx 
		Labels and descriptions of WDI variables

	data/wdi/WDIDATA-2020.csv 
		Word Development Indicators: Source: https://datacatalog.worldbank.org/dataset/world-development-indicators
		Downloaded 20 December 2019

- Figure2.do 
	data/oecd_trade/FRED_deflator_2020 (2015 base).csv
		2015 USD constant dollars deflator (Accessed 24 May 2020)
		Source: https://fred.stlouisfed.org/series/USAGDPDEFQISMEI

	data/oecd_trade/oecd_chinese_trade.dta
		Chinese Imports & Shocks calculated from OECD -- Bilateral Trade in Goods by Industry and End-use (BTDIxE), ISIC Rev.4 
		Source: https://stats.oecd.org/index.aspx?queryid=64755 (Accessed 2 June 2020)

	data/oecd_trade/oecd_lowwage_trade.dta
		Low-wage countries imports & shocks calculated from OECD -- Bilateral Trade in Goods by Industry and End-use (BTDIxE), ISIC Rev.4 
		Source: https://stats.oecd.org/index.aspx?queryid=64755 (Accessed 2 June 2020)

	data/ardeco/ardeco_regional_gdp.dta
		Regional GDP data
		Created from GDP at constant prices (Euro/Natl Currency 2015) (ROVGD) 
		Source: https://ec.europa.eu/knowledge4policy/territorial/ardeco-online_en
 		Last update: 7 April 2020
 
		

- Figure3.do 
	parties_votes/party_classifications.dta
		Hand-coded, as described in Appendix

	parties_votes/parlgov_election_05202020.csv
		ParlGov Election Data (Accessed 20 May 2020)
		Source: http://www.parlgov.org/data/table/view_election/ 

- Figure4.do 
	data/imputed/imputed_econdata_voteshare_merged.dta
		Cleaned and imputed econ data merged with regional elections data and set for MI analysis

- Individual Level Tables and Figures.do 
	data/ess/ess_subsample_econmerged.dta
		Cleaned ESS individual level data merged with imputed economic data

- Regional Voting Tables.do 
	data/imputed/imputed_econdata_voteshare_merged.dta
		Cleaned and imputed econ data merged with regional elections data and set for MI analysis

- SUREG_analysis.do 
	data/imputed/imputed_econdata_voteshare_merged.dta
		Cleaned and imputed econ data merged with regional elections data and set for MI analysis

- Tables A3 and A4.do 
	data/imputed/imputed_econdata_voteshare_merged.dta
		Cleaned and imputed econ data merged with regional elections data and set for MI analysis

- Unimputed Regional Voting Tables.do 
	data/parties_votes/CLEA_voteshare_turnout.dta
		Regional voteshare by party family, coded as described in Appendix

	data/imputed/regional_data_impute.dta
		Unimputed econ data, full set of variables used for Amelia II MI process
	
